<template>
	<div class="app-container">
		<div>
			<el-form :inline="true" :model="listQuery" class="demo-form-inline" @submit.native.prevent>
				<el-form-item label="主播姓名">
					<el-input v-model="listQuery.q_anchorName" size="small"></el-input>
				</el-form-item>
        <el-form-item label="会员名称">
					<el-input v-model="listQuery.q_memberName" size="small"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" icon="el-icon-search" size="small" @click="this.getList">查询</el-button>
					<el-button icon="el-icon-refresh" size="small" @click="reset">重置</el-button>
				</el-form-item>
			</el-form>
			<el-table ref="singleTable" v-loading="listLoading" :data="dataList" border fit highlight-current-row
				@current-change="handleCurrentChange" style="width: 100%">
				<el-table-column type="index" align="center" width="50"></el-table-column>
				<el-table-column property="videoName" width="200" label="直播间名称" show-overflow-tooltip></el-table-column>
				<el-table-column property="sellerName" width="200" label="商家名称" show-overflow-tooltip></el-table-column>
				<el-table-column property="anchorName" width="200" label="主播名称" show-overflow-tooltip></el-table-column>
				<el-table-column property="comment" width="300" label="评论内容" show-overflow-tooltip></el-table-column>
				<el-table-column property="memberName" width="200" label="评论人"></el-table-column>
				<el-table-column property="createTime" width="200" label="评论时间"></el-table-column>
			</el-table>
			<Pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
				@pagination="getList" />
		</div>
	</div>
</template>

<script>
	import {
		listLiveVideoComment
	} from '@/api/live'
	import Pagination from '@/components/Pagination'
	import {
		Message
	} from 'element-ui'
	export default {
		name: 'videocommentlist',
		components: {
			Pagination
		},
		data() {
			return {
				currentRow: null,
				dataList: [],
				total: 0,
				listLoading: true,
				listQuery: {
					page: 1,
					limit: 20,
					q_anchorName: '',
					q_memberName: ''
				}
			}
		},
		created() {
			this.getList()
		},
		methods: {
			handleCurrentChange(val) {
				// 选中当前行数据
				this.currentRow = val
			},
			// 获取列表数据
			getList() {
				this.listLoading = true
				listLiveVideoComment(this.listQuery).then(response => {
					this.dataList = response.data.rows
					this.total = response.data.total
					this.listLoading = false
				})
			},
			reset() {
				this.listQuery = {
					page: 1,
					limit: 20,
					q_anchorName: '',
					q_memberName: ''
				}
				this.getList()
			}
		}
	}
</script>

<style>
</style>
